<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>菜单编辑</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all" />
    <script src="https://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript" src="/static/layui/layui.js"></script>
    <script type="text/javascript" src="/static/js/base.js"></script>
</head>
<body>
    <div class="x-body">
        <form class="layui-form" id="addFormID" >
            <div style="width:100%;height:300px;overflow: auto;">
                <!--<div class="layui-form-item">-->
                    <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">-->
                        <!--<legend style="font-size:16px;">基础信息</legend>-->
                    <!--</fieldset>-->
                <!--</div>-->

                <div style="margin-top: 10px"></div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="permissionName" th:value="${JsonRootData.permissionName    }"  autocomplete="off" class="layui-input">
                            <input type="hidden" name="permissionId" th:value="${JsonRootData.permissionId    }"  autocomplete="off" class="layui-input">
                            <input type="hidden" name="pid" th:value="${JsonRootData.pid}">
                        </div>
                    </div>
                </div>

                <!--<div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">图标</label>
                        <div class="layui-input-inline">
                            <div style="margin-left: 20px;margin-top:5px">
                                <ul>
                                    <li style="display: inline-block;width: 50px;" id="menu-icon"><i class="layui-icon" id="icon"  style="font-size: 25px;"></i></li>
                                    <li style="display: inline-block;"><i class="layui-btn layui-btn-primary layui-btn-sm" id="select_icon">选择图标</i></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>-->

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">路径</label>
                        <div class="layui-input-inline">
                            <input type="text" name="permissionUrl" th:value="${JsonRootData.permissionUrl}" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">序号</label>
                        <div class="layui-input-inline">
                            <input type="number" name="seq"  th:value="${JsonRootData.seq}" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">资源描述</label>
                        <div class="layui-input-inline">
                            <input type="text" name="permissionType" th:value="${JsonRootData.permissionType}"  autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

            </div>
        </form>
    </div>

    <script>

        var table;
        var form;
        layui.use(['table','layer','upload','form','laydate'], function() {
            table = layui.table;
            form = layui.form;
            var laydate = layui.laydate;


        })

        function update() {
            var temp = 0;
            $.ajax({
                url : '/menu/update',
                data: $("#addFormID").serialize(),
                cache : false,
                type : "post",
                async:false,
                success:function (data) {
                    if (data) {
                        temp = 1;
                    } else {
                        temp = 0;
                    }
                }
            });
            return temp;
        }
    </script>

</body>
</html>